package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.adapter.PersonalArticlesAdapter;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;


/**
 * 时间 2017 年 08 月 27 日
 * 作者  Z2043 welbeing to hangzou com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * @desc  个人文章
 */
public class PersonalArticlesActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_personal_articles);


        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);

        XRecyclerView xRecyclerView = (XRecyclerView)findViewById(R.id.activity_personal_articles_xRecyclerView);


        View header =  View.inflate(this,R.layout.personal_articles_recyclerview_header,null);
        ImageView iv_raw = (ImageView)header.findViewById(R.id.personal_articles_recyclerview_header_iv_raw);
        ImageView iv_person_image = (ImageView)header.findViewById(R.id.personal_articles_recyclerview_header_iv_person_image);
        TextView tv_name = (TextView)header.findViewById(R.id.personal_articles_recyclerview_header_tv_name);
        RelativeLayout rl_pay_attention = (RelativeLayout)header.findViewById(R.id.personal_articles_recyclerview_header_rl_pay_attention);
        TextView tv_titile = (TextView)header.findViewById(R.id.personal_articles_recyclerview_header_tv_titile);
        TextView tv_content = (TextView)header.findViewById(R.id.personal_articles_recyclerview_header_tv_content);
        TextView tv_yesterday = (TextView)header.findViewById(R.id.personal_articles_recyclerview_header_tv_yesterday);
        TextView tv_data = (TextView)header.findViewById(R.id.personal_articles_recyclerview_header_tv_data);


        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        xRecyclerView.setLayoutManager(layoutManager);
        xRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
        xRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);

        xRecyclerView.addHeaderView(header);
        xRecyclerView.setPullRefreshEnabled(false);
        PersonalArticlesAdapter personalArticlesAdapter =  new PersonalArticlesAdapter();
        xRecyclerView.setAdapter(personalArticlesAdapter);



    }
}
